package cn.corffen.test.algorithm.test;

public class FlyWeight {
    static ObjectPool pool;

    static {
        pool = new ObjectPool();
        System.out.println("静态代码块");
    }

    public FlyWeight() {
        System.out.println("构造方法");
    }

    public static void main(String[] args) {
        FlyWeight.getInstance();
    }

    public static void getInstance() {
        int i = pool.get();
        System.out.println(i + "");
    }
}

class ObjectPool {
    public int get() {
        return 1;
    }
}
